<?php
/**
 * @link http://www.yiiframework.com/
 * @copyright Copyright (c) 2008 Yii Software LLC
 * @license http://www.yiiframework.com/license/
 */

namespace zhtfrontend\assets;

use yii\web\AssetBundle;

/**
 * @author Qiang Xue <qiang.xue@gmail.com>
 * @since 2.0
 */
class TouchAsset extends AssetBundle
{
    public $basePath = '@webroot';
    public $baseUrl = '@web';
    public $touch=false;
    public $clock=false;
    public $css = [
        'css/touch.css?v=201606302',
    ];
    public $js = [

    ];

    public $depends = [
        'yii\web\YiiAsset',
    ];
    public function registerAssetFiles($view)
    {
        if ($this->touch) {
            $js = [
                'scripts/jquery.event.drag.js',
                'scripts/jquery.touchSlider.js',
                'scripts/iscroll.js',
                'scripts/touch.js',
            ];
            $this->js=array_merge($this->js,$js);
        }
        if($this->touch){
            $css=[
                'css/common.css',
                'css/jPages.css'
            ];
            $this->css=array_merge($this->css,$css);
        }
        if($this->clock){
            $js=[
                'scripts/clock.js',
            ];
            $this->js=array_merge($this->js,$js);
        }
        parent::registerAssetFiles($view);
    }

}